/*
 * Copyright (c) 2006, 2022, webrx.cn All rights reserved.
 *
 */
package cn.ex;

import java.util.Random;

/**
 * <p>Project: jse2204 - Ex101
 * <p>Powered by webrx On 2022-09-01 15:26:26
 *
 * @author webrx [webrx@126.com]
 * @version 1.0
 * @since 17
 */
public class Ex101 {
    public static void main(String[] args) {

        //System.out.println(Math.random());
        //System.out.println(Math.round(1));
        //System.out.println(Math.round(.0));
        //System.out.println(Math.round(.1));
        //System.out.println(Math.round(.5));
        //System.out.println(Math.round(.9));

        System.out.println(Math.random());

        //输入什么？1 或 0
        //System.out.println(Math.round(Math.random()) == 0 ? "yes" : "no");
        //System.out.println(Math.random() > .5 ? "yes" : "no");

        Random rand = new Random();
        for (int i = 0; i < 20; i++) {
            //0 - 5 随机整数
            //long num = Math.round(Math.random() * 5);
            //System.out.println(num);

            //10 - 20 随机整数
            // a - b 随机整数(long)  Math.round(Math.random() * (b-a)) + a;
            //long num = Math.round(Math.random() * (20 - 10)) + 10;
            //long time = Math.round(Math.random() * (end - start)) + start;

            var num = rand.nextInt(5);
            System.out.println(num);
        }


    }
}
